<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">

<h:head>
	<title>Editare</title>
</h:head>
<h:body style="background-color:#CCFFE6">
	<h:form>
		<div align="right">
				<h:commandButton value="Back"
					action="#{administratorBean.home}"></h:commandButton>

				<h:commandButton value="Logout"
					action="#{administratorBean.logout}"></h:commandButton>


		</div>
		<h2 align="center" style="font-family: Comic Sans MS; color: #003900">Editare chestionar</h2>


		<h:messages style="color:red"></h:messages>
		<h:outputText value="Titlu: "></h:outputText>
		<h:inputText titlu=" " value="#{editBean.nume}" required="true"
			label="Titlu"></h:inputText>
		<br />
		<br />
		<h:outputText value="Chestionar activ: "></h:outputText>
		<h:selectBooleanCheckbox id="activ" value="#{editBean.activ}" title="Activ" />
		<br />
		<br />
		<h:commandButton value="Adauga intrebare"
			action="#{editBean.addIntrebare}"></h:commandButton>

		<br />

		<h3
			style="font-family: Georgia; background-color: #003900; color: white; font-size: 23">Intrebari</h3>


		<h:dataTable value="#{editBean.chestionar.intrebari}" var="intrebare"
			styleClass="order-table" headerClass="order-table-header"
			rowClasses="order-table-odd-row,order-table-even-row">

			<h:column>
			<h:outputText value="#{intrebare.text}" rendered="#{!intrebare.markedForDelete}"></h:outputText>
                
			</h:column>
			<h:column>
				<h:commandLink value="Edit" action="#{editBean.edit}" rendered="#{!intrebare.markedForDelete}">
					<f:param name="intrebareSelected" value="#{intrebare.orderNo}" />
				</h:commandLink>
			</h:column>
			<h:column>
				<h:commandLink action="#{editBean.delete}" rendered="#{!intrebare.markedForDelete}">
					<f:param name="intrebareSelected" value="#{intrebare.orderNo}" />
					<h:graphicImage
						value="x_button.png"
						style="height: 26px; width: 26px" />

				</h:commandLink>
			</h:column>
		</h:dataTable>
		<br />
		<h:commandButton value="Salveaza Chestionar" action="#{editBean.save}"></h:commandButton>
	</h:form>
</h:body>
</html>